package com.drug.lib.view.load;

import com.drug.lib.R;

public enum LoadStatus {
    SUCCESS("加载完成", 0x111, 0),
    NETWORK_ERROR("暂时无网络,请重试", 0x222, R.mipmap.net_erro),
    LOADING("数据加载中...", 0x333, 0),
    NODATA("未加载到数据", 0x444, R.mipmap.ic_nodata),
    LOAD_FAILD("网络加载失败", 0x555, R.mipmap.load_faild);

    private String name;
    private int status;
    private int image;

    LoadStatus(String name, int status, int image) {
        this.name = name;
        this.status = status;
        this.image = image;
    }

    public static String getName(int status) {
        for (LoadStatus loadStatus : LoadStatus.values()) {
            if (loadStatus.getStatus() == status)
                return loadStatus.getName();
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getImage() {
        return image;
    }

    public void setImage(int image) {
        this.image = image;
    }
}
